/*
 * The LevelDB-CLI Project
 * Copyright (C) 2024 JuRuoqwq<BitPasta@163.com>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */

#ifndef TOKEN_H
#define TOKEN_H

#include <string>

// 遵循leveldb明命名逻辑
enum TokenTypes {
    // Operations
    SET,
    GET,
    DELETE,
    SHOW,
    CLOSE,
    CLEAR,
    // 操作的具体数据类型
    OPTIONS, // 用户通过option来操作leveldb::options
    READ_OPTIONS,
    WRITE_OPTIONS,
    // Options
    CREATE_IF_MISSING,
    ERROR_IF_EXISTS,
    PARANOID_CHECKS,
    WRITE_BUFFER_SIZE,
    MAX_OPEN_FILES,
    BLOCK_SIZE,
    BLOCK_RESTART_INTERVAL,
    MAX_FILE_SIZE,
    ZSTD_COMPRESSION_LEVEL,
    REUSE_LOGS,
    VERIFY_CHECKSUMS,
    FILL_CACHE,
    SYNC,
    // Others
    PARAM,
    // 内置命令
    HELP,
    VERSION,
    QUIT,
    OPEN
};

struct Token {
    Token(TokenTypes t, std::string s) : type(t), source(s) {}
    TokenTypes type;
    std::string source;
};

#endif